import Mock from "mockjs";

let List = [];
export default {
  getStatisticalData: () => {
    for (let i = 0; i < 7; i++) {
      List.push(
        Mock.mock({
          苹果: Mock.Random.float(100, 8000, 0, 0),
          oppo: Mock.Random.float(100, 8000, 0, 0),
          vivo: Mock.Random.float(100, 8000, 0, 0),
          小米: Mock.Random.float(100, 8000, 0, 0),
          魅族: Mock.Random.float(100, 8000, 0, 0),
          三星: Mock.Random.float(100, 8000, 0, 0),
          华为: Mock.Random.float(100, 8000, 0, 0),
        })
      );
    }

    return {
      code: 200,
      data: {
        //饼图
        videoData: [
          {
            name: "小米",
            value: 2999,
          },
          {
            name: "三星",
            value: 1999,
          },
          {
            name: "魅族",
            value: 1500,
          },
          {
            name: "苹果",
            value: 5999,
          },
          {
            name: "oppo",
            value: 2001,
          },
          {
            name: "vivo",
            value: 2208,
          },
        ],
        //柱状图
        userData: [
          {
            date: "周一",
            new: 5,
            active: 200,
          },
          {
            date: "周二",
            new: 10,
            active: 300,
          },
          {
            date: "周三",
            new: 12,
            active: 110,
          },
          {
            date: "周四",
            new: 60,
            active: 210,
          },
          {
            date: "周五 ",
            new: 40,
            active: 800,
          },
          {
            date: "周六 ",
            new: 45,
            active: 805,
          },
          {
            date: "周日 ",
            new: 20,
            active: 600,
          },
        ],
        //折线图
        orderData: [
          {
            date: [
              20221001, 20221002, 20221003, 20221004, 20221005, 20221006,
              20221007,
            ],
            data: List,
          },
        ],
        tableData: [
          { name: "oppo", todayBuy: 500, monthBuy: 3500, totalBuy: 22000 },
          { name: "vivi", todayBuy: 300, monthBuy: 4500, totalBuy: 24000 },
          { name: "小米", todayBuy: 800, monthBuy: 3660, totalBuy: 21000 },
          { name: "三星", todayBuy: 1000, monthBuy: 5500, totalBuy: 20000 },
          { name: "华为", todayBuy: 500, monthBuy: 7000, totalBuy: 24000 },
          { name: "魅族", todayBuy: 600, monthBuy: 8000, totalBuy: 15000 },
          { name: "苹果", todayBuy: 900, monthBuy: 7700, totalBuy: 30000 },
        ],
      },
    };
  },
};
